﻿using System;
using System.Windows.Forms;

namespace stdCall.MyUtils
{
    /// <summary>
    /// 实用类
    /// </summary>
    class Utils
    {
        /// <summary>
        /// 延迟函数，毫秒级
        /// </summary>
        /// <param name="delayTime">延迟时间，毫秒级</param>
        /// <returns></returns>
        public static bool Delay(int delayTime)
        {
            DateTime now = DateTime.Now;
            int s;
            do
            {
                TimeSpan spand = DateTime.Now - now;
                s = spand.Milliseconds;
                Application.DoEvents();
            }
            while (s < delayTime);
            return true;
        }
    }
}
